package com.sec.android.app.myfiles.module.abstraction;

import android.content.Context;

import com.sec.android.app.myfiles.module.ContentObservable;

/**
 * Created by daesu83.kim on 2015-07-21.
 */
public abstract class AbsContentObserverImp {
    protected FileRecord mTargetRecord;
    protected ContentObservable mUpdater;
    public Context mContext;

    public AbsContentObserverImp(Context context, FileRecord record, ContentObservable updater) {
        mTargetRecord = record;
        mUpdater = updater;
        mContext = context;
    }

    protected void notifyContentChanged(int event) {
        if (mUpdater != null) {
            mUpdater.onContentChanged(mTargetRecord, event);
        }
    }

    public void destroy() {
        mTargetRecord = null;
        mUpdater = null;
        mContext = null;
    }


    public abstract void start();

    public abstract void stop();

    public abstract void onEvent(int event);

}
